package com.example.jdk17;

public class SwitchTest {
    public static void main(String[] args) {
        Object str = "hello switch pattern";
        if (str instanceof String s) {
            System.out.println("proccess string");
        } else if (str instanceof Integer i) {
            System.out.println("proccess integer");
        } else {
            System.out.println("Unkonw type");
        }



        /*switch (str) {
            case String s -> System.out.println("proccess string");
            case Integer i -> System.out.println("procces integer");
            default -> System.out.println("Unkonw type");
        }*/
    }
}
